package com.qiangqiang.taskuser.util;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * @author : Eumenides
 * @date : 2018/07/15
 * @description :
 */
public class TimeFormat {

    /**
     * @param time:Long型时间
     * @return java.lang.String
     * @describe: 时间转换 Long-->String
     */
    public static String converTime(long time) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        return dtf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault()));
    }
}
